package com.company.behavioral.interparter_pattern.nonterminal_expression;

import com.company.behavioral.interparter_pattern.abstract_expression.AbstractNode;

/**
 * And 节点类
 * @ClassName AndNode
 * @Author tiezheng.han
 * @Date 2020/9/4 10:32
 **/
public class AndNode extends AbstractNode {

    /**
     * And的左表达式
     */
    private AbstractNode left;

    /**
     * And 的右表达式
     */
    private AbstractNode right;

    public AndNode(AbstractNode left, AbstractNode right) {
        this.left = left;
        this.right = right;
    }

    /**
     * And表达式解释操作
     * @return
     */
    @Override
    public String interpret() {
        return left.interpret()+ "再" + right.interpret();
    }


}
